import numpy as np

# 矩阵点乘来计算
X = np.array([[1.2, 1.5, 1.8],
 [1.3, 1.4, 1.9],
 [1.1, 1.6, 1.7]])
Y = np.array([5, 10, 9]).T


print(np.dot(X, Y))

# 循环的方式计算
xy=[]
XY=[]
for i in X:
    func = lambda x, y: x * y
    result = map(func, i, Y)
    list_result = list(result)
    xy.append(list_result)
for i in xy:
    XY.append(round(sum(i),2))

print(XY)


